var e = require("../../utils/config");

Page({
    data: {
        webViewUrl: "",
        appid: ""
    },
    onLoad: function(n) {
        console.log("webview options:", n);
        var o = new Date(), t = Date.parse(o.toString()), i = "";
        if (n.h5 && (i = decodeURIComponent(n.h5)), 0 != n.isTimestamp) {
            var a = i.indexOf("?") > -1 ? "&" : "?";
            i = "".concat(i).concat(a, "v=").concat(t);
        }
        console.log("webwiew:" + i), this.setData({
            webViewUrl: i,
            appid: e.appid
        }), console.log(this.data.webViewUrl);
    },
    onReady: function() {},
    onShow: function() {
        wx.hideHomeButton();
    },
    onHide: function() {},
    onUnload: function() {
        console.log("页面栈：", getCurrentPages());
    },
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function(n) {
        return console.log("WebView用户点击右上角分享", n), n.webViewUrl.indexOf(e.selfSelectedOrderUrl + "attention") > -1 ? {
            title: "体检注意事项",
            path: "/pages/webview/webview?h5=".concat(encodeURIComponent(e.selfSelectedOrderUrl + "attention"))
        } : {
            title: "瑞慈体检预约",
            path: "/pages/index/index"
        };
    }
});